package com.zy.ioc.pro8_init_destroy;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component  //单例 ，非懒
public class ConnectionPool {

    public ConnectionPool() {
        System.out.println("ConnectionPool 构造方法");
    }

    @PostConstruct
    public void init(){
        System.out.println("ConnectionPool init 方法");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("ConnectionPool destroy 方法");
    }
}
